Skip to content

test: events sent during remote join handshake should not be lost#847

Open
FrenchGithubUser wants to merge 4 commits intomatrix-org:mainfrom
famedly:remote-join-handshake
Open

test: events sent during remote join handshake should not be lost#847
FrenchGithubUser wants to merge 4 commits intomatrix-org:mainfrom
famedly:remote-join-handshake

Conversation

@FrenchGithubUser
Copy link
Copy Markdown
Contributor

@FrenchGithubUser FrenchGithubUser commented Mar 4, 2026

Test for element-hq/synapse#19390

Disclaimer

As I'm not super fluent with go, I used a lot of AI to write this test. However, I did review it as best as I could together with someone else from Famedly.

Pull Request Checklist

Signed-off-by: Thomas Traineau t.traineau@famedly.com

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a regression test to ensure events created during the federation join handshake (between /make_join and /send_join) remain discoverable to the joining server, preventing missed events / unreachable forward extremities during joins.

Changes:

  • Added TestEventBetweenMakeJoinAndSendJoinIsNotLost to assert intervening events become discoverable (directly or via prev_events references).
  • Implemented a custom federation /_matrix/federation/v1/send/{transactionID} handler to observe outbound PDUs before the Complement server is in the room.
  • Added io import to read raw transaction bodies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread tests/federation_room_join_test.go
Comment thread tests/federation_room_join_test.go Outdated
Comment thread tests/federation_room_join_test.go
Comment thread tests/federation_room_join_test.go
Comment thread tests/federation_room_join_test.go Outdated
Comment thread tests/federation_room_join_test.go Outdated
Comment thread tests/federation_room_join_test.go Outdated
Comment thread tests/federation_room_join_test.go Outdated
Comment thread tests/federation_room_join_test.go
Comment thread tests/federation_room_join_test.go
Comment thread tests/federation_room_join_test.go
Copy link
Copy Markdown
Collaborator

@MadLittleMods MadLittleMods left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates so far @FrenchGithubUser! This is looking close

Comment thread tests/federation_room_join_test.go Outdated
Comment thread tests/federation_room_join_test.go Outdated
Comment thread tests/federation_room_join_test.go
@FrenchGithubUser
Copy link
Copy Markdown
Contributor Author

FrenchGithubUser commented Apr 24, 2026

Had a few hiccups with git, I hope I didn't mess something up, but looks fine

Comment thread tests/federation_room_join_test.go Outdated
// extremities, prompting the joining server to backfill.
//
// See https://github.com/element-hq/synapse/pull/19390
func TestEventBetweenMakeJoinAndSendJoinIsNotLost(t *testing.T) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @FrenchGithubUser. The test looks good now. Just a case of deciding where it should go:

Discussion for whether this should live in the Complement repo or as a in-repo Complement test, element-hq/synapse#19390 (comment)

Comment thread tests/federation_room_join_test.go
Co-authored-by: Eric Eastwood <madlittlemods@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants